package models

import (
	"gorm.io/gorm"
	"time"
)

type Essays struct {
	Id         uint64         `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	UserId     uint64         `gorm:"column:user_id;type:bigint UNSIGNED;not null;" json:"user_id"`
	EssayTitle string         `gorm:"column:essay_title;type:varchar(50);comment:文章标题;not null;" json:"essay_title"` // 文章标题
	EssayInfo  string         `gorm:"column:essay_info;type:text;comment:文章内容;" json:"essay_info"`                   // 文章内容
	CreatedAt  time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt  time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}
